package app.conf;

import static springfox.documentation.builders.PathSelectors.regex;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
 * @author shishun.wang
 * @date 下午5:37:30 2016年4月21日
 * @version 1.0
 * @describe
 */
@Configuration
@EnableSwagger2
public class SwaggerAutoConfiguration {

	@Bean
	public Docket swaggerSpringMvcPlugin() {
		ApiInfo apiInfo = new ApiInfo("数据中心", "基础数据", null, null, null, null, null);
		Docket docket = new Docket(DocumentationType.SWAGGER_2).select()
				.paths(regex(".*?.*")).build()
//				.paths(regex(".*rest.*")).build()
				.apiInfo(apiInfo).useDefaultResponseMessages(false);
		return docket;
	}
}
